package com.youtui.manager.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.github.pagehelper.PageInfo;
import com.youtui.common.constant.ResultMessage;
import com.youtui.common.util.ResultUtil;
import com.youtui.manager.entity.WithdrawalEntity;
import com.youtui.manager.service.IWithdrawalService;

@Controller
@RequestMapping("/withdrawal")
public class WithdrawalController extends BaseController {

	@Autowired
	IWithdrawalService withdrawalService;

	@RequestMapping("/pagelist.do")
	@ResponseBody
	public ResultMessage findPageList(Long devId, @RequestParam(value = "page", defaultValue = "1") Integer page,
			@RequestParam(value = "rows", defaultValue = "20") Integer rows) {

		if (devId == null) {
			return ResultUtil.result(ResultUtil.code_success, "开发者提现列表");
		}

		PageInfo<WithdrawalEntity> pageinfo = withdrawalService.findWithdrawalPageList(devId, page, rows);
		return ResultUtil.result(ResultUtil.code_success, "开发者提现列表", pageinfo);
	}

}
